package com.fowo.api.sys.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fowo.api.sys.entity.SysTaskDataSource;
import com.fowo.api.sys.mapper.SysTaskDataSourceMapper;
import com.fowo.api.sys.model.SysTaskDataSourceSearch;
import com.fowo.api.sys.service.SysTaskDataSourceService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysTaskDataSourceServiceImpl
    extends ServiceImpl<SysTaskDataSourceMapper, SysTaskDataSource>
    implements SysTaskDataSourceService
{
    @Override
    public Page<SysTaskDataSource> searchPage(SysTaskDataSourceSearch search) {
        return baseMapper.searchPage(search.toPage(), search);
    }

    @Override
    public List<SysTaskDataSource> search(SysTaskDataSourceSearch search) {
        return baseMapper.search(search);
    }

    @Override
    public SysTaskDataSource getById(Long id) {
        return super.getById(id);
    }

    @Override
    public boolean create(SysTaskDataSource sysTaskDataSource) {
        return save(sysTaskDataSource);
    }

    @Override
    public boolean update(SysTaskDataSource sysTaskDataSource) {
        return updateById(sysTaskDataSource);
    }

    @Override
    public boolean delete(Long id) {
        return removeById(id);
    }
}
